import { BrowserModule } from "@angular/platform-browser";
import { NgModule, HostBinding } from "@angular/core";
import { AppRoutingModule } from "./app-routing.module";
import { AppComponent } from "./app.component";
import { CoreModule } from "./core/core.module";
import { HttpClientModule } from "@angular/common/http";
import { SharedModule } from "./shared/shared.module";
import { APP_CONFIG } from "./app-config";
import { environment } from "src/environments/environment";

import {
  NgZorroAntdModule,
  NZ_I18N,
  zh_CN,
  NzConfig,
  NZ_CONFIG
} from "ng-zorro-antd";
import { FormsModule } from "@angular/forms";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { registerLocaleData } from "@angular/common";
import zh from "@angular/common/locales/zh";
import { ApplicationService } from "./core/application.service";
import { NgxsModule } from "@ngxs/store";
import { NgxsLoggerPluginModule } from "@ngxs/logger-plugin";
import { AppState } from "./app-store";
import { SettingState } from "./view-model/setting/setting-store";
import { UEditorModule  } from "ngx-ueditor";
import { RouteReuseStrategy } from "@angular/router";
import { AppReuseStrategy } from "./core/route/app-reuse-strtegy";
import { ClipboardModule } from "ngx-clipboard";


registerLocaleData(zh);

const ngZorroConfig: NzConfig = {
  table: { nzSize: "middle" }
};

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    CoreModule.forRoot({}),
    SharedModule,
    HttpClientModule,
    AppRoutingModule,
    NgZorroAntdModule,
    FormsModule,
    BrowserAnimationsModule,
    NgxsModule.forRoot([AppState, SettingState], {
      developmentMode: !environment.production
    }),
    NgxsLoggerPluginModule.forRoot(),
    ClipboardModule
  ],
  providers: [
    { provide: APP_CONFIG, useValue: environment },
    { provide: NZ_I18N, useValue: zh_CN },
    { provide: NZ_CONFIG, useValue: ngZorroConfig },
    { provide: RouteReuseStrategy, useClass: AppReuseStrategy},
    // AppReuseStrategy
  ],
  bootstrap: [AppComponent]
})
export class AppModule {
  @HostBinding("@.disabled")
  public animationsDisabled = false;

  constructor(private applicationService: ApplicationService) {}
}
